.chapter-preview {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  width: 100%;
}

.chapter-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  min-height: 0;
}

.outline-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
  background-color: #fff;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.outline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.outline-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.outline-title.clickable {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.outline-title.clickable:hover {
  color: #18a058;
}

.outline-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.outline-display {
  flex: 1;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.outline-display:hover {
  background-color: #e9ecef;
}

.outline-display:empty::before {
  content: "双击编辑章节细纲";
  color: #999;
}

.outline-input {
  flex: 1;
}

/* 正文区域样式 */
.content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 确保flex子项可以缩小 */
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0; /* 确保flex子项可以缩小 */
}

.content-input {
  flex: 1;
  min-height: 0; /* 确保flex子项可以缩小 */
  padding: 16px;
  border: none;
  border-radius: 8px;
  background-color: #fff;
  resize: none;
  font-family: inherit;
  line-height: 1.6;
  transition: all 0.3s ease;
  outline: none;
}

.content-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(24, 160, 88, 0.2);
}

/* 生成状态时的样式 */
.content-generating {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-height: 0; /* 确保flex子项可以缩小 */
}

.streaming-content {
  flex: 1;
  width: 100%;
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
  background-color: #fff;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 0; /* 确保flex子项可以缩小 */
  border-radius: 6px;
  border: 1px solid #f0f0f0;
  margin-bottom: 16px; /* 为底部动画留出空间 */
}

.streaming-content:empty::before {
  content: "正在生成内容...";
  color: #999;
}

.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0; /* 防止动画被压缩 */
}

.loading-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.loading-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #1890ff;
  animation: pulse 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes pulse {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  color: #666;
}

.empty-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  width: 100%;
}

/* 生成按钮样式 */
.generate-btn {
  align-self: flex-end;
  margin-top: 8px;
}

.save-button {
  margin-right: 8px;
}

.generate-content-button {
  background-color: #18a058;
}

.generate-content-button:hover {
  background-color: #158a4d;
}

/* 对话框样式 */
.generate-modal .n-form-item {
  margin-bottom: 24px;
}

.generate-modal .n-select {
  width: 100%;
}

/* 滚动条样式 */
.content-section::-webkit-scrollbar {
  width: 6px;
}

.content-section::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.content-section::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.content-section::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}